import {createRouter, createWebHistory} from 'vue-router'

const routes = [{
    path: '/',
    redirect: '/main'
}, {
    path: '/main',
    component: () => import('../components/main/Main'),
    children: [{
        path: '/main',
        redirect: '/main/table'
    }, {
        path: '/main/table',
        component: () => import('../components/table/Table')
    }, {
        path: '/main/field',
        component: () => import('../components/field/Field')
    }]
}]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default (app) => {
    app.use(router)
}
